package demoMod.nanaki.cards.tempCards;

import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.powers.AbstractPower;
import demoMod.nanaki.NanakiMod;

import java.util.stream.Collectors;

public class Reborn extends AbstractBlessingCard {
    public static final String ID = NanakiMod.makeID("Reborn");

    private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    public static final String NAME = cardStrings.NAME;
    public static final String DESCRIPTION = cardStrings.DESCRIPTION;
    public static final String IMG_PATH = "cards/Reborn_skill.png";

    public Reborn() {
        super(ID, NAME, NanakiMod.getResourcePath(IMG_PATH), DESCRIPTION);
        this.baseMagicNumber = this.magicNumber = 3;
    }

    @Override
    protected void drawnEffect() {
        for (AbstractPower power : AbstractDungeon.player.powers.stream().filter(p -> p.type == AbstractPower.PowerType.DEBUFF).collect(Collectors.toList())) {
            addToTop(new RemoveSpecificPowerAction(AbstractDungeon.player, AbstractDungeon.player, power));
        }
        addToTop(new DrawCardAction(this.magicNumber));
    }
}
